home *** CD-ROM | disk | FTP | other *** search
/ ftp.mactech.com 2010 / ftp.mactech.com.tar / ftp.mactech.com / thinkref / archive / THINKPascalUH2.1.sea / THINKPas Univ Hdr 2.1 / Interfaces / CommResources.p < prev    next >
Text File  |  1995-09-12  |  4KB  |  105 lines

  1. { Converted with MPW2TPas Tuesday, September 12, 1995 5:34:29 PM }
  2. {
  3.      File:        CommResources.p
  4.  
  5.      Contains:    Communications Toolbox Resource Manager Interfaces.
  6.  
  7.      Version:    Technology:    System 7.5
  8.                  Package:    Universal Interfaces 2.1 in “MPW Latest” on ETO #18
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  14.                  stack.  Include the file and version information (from above)
  15.                  in the problem description and send to:
  16.                      Internet:    apple.bugs@applelink.apple.com
  17.                      AppleLink:    APPLE.BUGS
  18.  
  19. }
  20.  
  21.  UNIT CommResources;
  22.  INTERFACE
  23.  
  24.  
  25. {$IFC UNDEFINED __COMMRESOURCES__}
  26. {$SETC __COMMRESOURCES__ := 1}
  27.  
  28.   USES
  29.    ConditionalMacros, Types, OSUtils;
  30.  
  31. { $PUSH}
  32. { $ALIGN MAC68K}
  33. { $LibExport+}
  34.  
  35. CONST
  36. {    tool classes (also the tool file types)    }
  37.     classCM                        = 'cbnd';
  38.     classFT                        = 'fbnd';
  39.     classTM                        = 'tbnd';
  40.  
  41. {    version of the Comm Resource Manager    }
  42.     curCRMVersion                = 2;
  43. { constants general to the use of the Communications Resource Manager }
  44.     crmType                        = 9;                            { queue type    }
  45.     crmRecVersion                = 1;                            { version of queue structure }
  46. {    error codes }
  47.     crmGenericError                = -1;
  48.     crmNoErr                    = 0;
  49.  
  50. { data structures general to the use of the Communications Resource Manager }
  51.     
  52. TYPE
  53.     CRMErr = OSErr;
  54.  
  55.     CRMRec = RECORD
  56.         qLink:                    QElemPtr;                                {reserved}
  57.         qType:                    INTEGER;                                {queue type -- ORD(crmType) = 9}
  58.         crmVersion:                INTEGER;                                {version of queue element data structure}
  59.         crmPrivate:                LONGINT;                                {reserved}
  60.         crmReserved:            INTEGER;                                {reserved}
  61.         crmDeviceType:            LONGINT;                                {type of device, assigned by DTS}
  62.         crmDeviceID:            LONGINT;                                {device ID; assigned when CRMInstall is called}
  63.         crmAttributes:            LONGINT;                                {pointer to attribute block}
  64.         crmStatus:                LONGINT;                                {status variable - device specific}
  65.         crmRefCon:                LONGINT;                                {for device private use}
  66.     END;
  67.  
  68.     CRMRecPtr = ^CRMRec;
  69.  
  70.  
  71. FUNCTION InitCRM: CRMErr;
  72. FUNCTION CRMGetHeader: QHdrPtr;
  73. PROCEDURE CRMInstall(crmReqPtr: CRMRecPtr);
  74. FUNCTION CRMRemove(crmReqPtr: CRMRecPtr): OSErr;
  75. FUNCTION CRMSearch(crmReqPtr: CRMRecPtr): CRMRecPtr;
  76. FUNCTION CRMGetCRMVersion: INTEGER;
  77. FUNCTION CRMGetResource(theType: ResType; theID: INTEGER): Handle;
  78. FUNCTION CRMGet1Resource(theType: ResType; theID: INTEGER): Handle;
  79. FUNCTION CRMGetIndResource(theType: ResType; index: INTEGER): Handle;
  80. FUNCTION CRMGet1IndResource(theType: ResType; index: INTEGER): Handle;
  81. FUNCTION CRMGetNamedResource(theType: ResType; name: ConstStr255Param): Handle;
  82. FUNCTION CRMGet1NamedResource(theType: ResType; name: ConstStr255Param): Handle;
  83. PROCEDURE CRMReleaseResource(theHandle: Handle);
  84. FUNCTION CRMGetToolResource(procID: INTEGER; theType: ResType; theID: INTEGER): Handle;
  85. FUNCTION CRMGetToolNamedResource(procID: INTEGER; theType: ResType; name: ConstStr255Param): Handle;
  86. PROCEDURE CRMReleaseToolResource(procID: INTEGER; theHandle: Handle);
  87. FUNCTION CRMGetIndex(theHandle: Handle): LONGINT;
  88. FUNCTION CRMLocalToRealID(bundleType: ResType; toolID: INTEGER; theType: ResType; localID: INTEGER): INTEGER;
  89. FUNCTION CRMRealToLocalID(bundleType: ResType; toolID: INTEGER; theType: ResType; realID: INTEGER): INTEGER;
  90. FUNCTION CRMGetIndToolName(bundleType: OSType; index: INTEGER; VAR toolName: Str255): OSErr;
  91. FUNCTION CRMFindCommunications(VAR vRefNum: INTEGER; VAR dirID: LONGINT): OSErr;
  92. FUNCTION CRMIsDriverOpen(driverName: ConstStr255Param): BOOLEAN;
  93. FUNCTION CRMParseCAPSResource(theHandle: Handle; selector: ResType; VAR value: LONGINT): CRMErr;
  94. FUNCTION CRMReserveRF(refNum: INTEGER): OSErr;
  95. FUNCTION CRMReleaseRF(refNum: INTEGER): OSErr;
  96.  
  97. { $ALIGN RESET}
  98. { $POP}
  99.  
  100. {$ENDC} {__COMMRESOURCES__}
  101.  
  102.  IMPLEMENTATION
  103.  END.
  104.  
  105.